package com.zds.hj.poseidon.biz.common;

import com.zds.hj.icmc.facade.auth.assetcenter.dto.req.FourElementsVerifyReqDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.req.LegalRepresentativeVerifyReqDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.req.LiveVerifyReqDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.resp.AuthRespDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.resp.FourElementsVerifyRespDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.resp.LegalRepresentativeVerifyRespDto;
import com.zds.hj.icmc.facade.auth.assetcenter.dto.resp.LiveVerifyRespDto;
import com.zds.hj.icmc.facade.dto.capitallnfo.CapitalInfoDto;
import com.zds.hj.icmc.facade.dto.common.applyinput.CreditApplyInputDto;
import com.zds.hj.icmc.facade.dto.common.applyinput.resp.ApplyInputRespDto;
import com.zds.hj.icmc.facade.interfaces.auth.AuthInterface;
import com.zds.hj.icmc.facade.interfaces.capitall.CapitalInterface;
import com.zds.hj.icmc.facade.interfaces.inputapply.ApplyInputInterface;
import com.zds.zly.common.constant.CommConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author duanhao
 * @Description 文件服务接口
 * @Date 2023/6/8 15:03
 */
@Slf4j
@Service
public class IcmcServiceInterface {

    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION,timeout = 90000000)
    private ApplyInputInterface applyInputInterface;


    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION)
    private AuthInterface authInterface;
    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION)
    private CapitalInterface capitalInterface;



    /**
     * 远程调用企业与法人关系校验
     * @return
     */
    public AuthRespDto<LegalRepresentativeVerifyRespDto> legalRepresentativeVerifyRespDtoAuthRespDto(
            LegalRepresentativeVerifyReqDto legalRepresentativeVerifyReqDto){
        return authInterface.legalRepresentativeVerify(legalRepresentativeVerifyReqDto);
    }

    public AuthRespDto<LiveVerifyRespDto> liveVerify(LiveVerifyReqDto reqDto) {

        return authInterface.liveVerify(reqDto);

    }
    public AuthRespDto<FourElementsVerifyRespDto> fourElementsVerify(FourElementsVerifyReqDto reqDto) {

        return authInterface.fourElementsVerify(reqDto);

    }
    /**
     * 根据产品编号查询资金方
     * @param productNo
     * @return
     */
    public List<CapitalInfoDto> getCapitalByProNo(String productNo) {
        List<CapitalInfoDto> capitalInfoDtoList = capitalInterface.getCapitalByProNo(productNo);
        return capitalInfoDtoList;
    }

    /**
     *通过资金方编号获取资金方
     * @param capitalSideNo
     * @return
     */
    public CapitalInfoDto getCapitalByNo(String capitalSideNo){
        CapitalInfoDto capitalInfoDtoList1=capitalInterface.getCapitalByNo(capitalSideNo);
        return capitalInfoDtoList1;
    }

    /**
     * 云链融授信进件接口
     * @param creditApplyInputDto creditApplyInputDto
     * @return ApplyInputRespDto
     */
    public ApplyInputRespDto ylrInputCreditApply(CreditApplyInputDto creditApplyInputDto){
        return applyInputInterface.ylrInputCreditApply(creditApplyInputDto);
    }
}
